import vue from "vue"

import VueRouter from "vue-router"

vue.use(VueRouter)

const login = () =>
    import ("../components/login.vue")
const Home = () =>
    import ("../components/Home.vue")

//用户列表
const user = () =>
    import ("../components/right/user.vue")

//权限管理组件
const juese = () =>
    import ("../components/manage/juese.vue")
const power = () =>
    import ("../components/manage/power.vue")


//商品管理组件
const goodHome = () =>
    import ("../components/goods/goodHome")
const goodlist = () =>
    import ("../components/goods/goodlist")
const classify = () =>
    import ("../components/goods/classify")
const goodclassify = () =>
    import ("../components/goods/goodclassify")

//订单管理
const order = () =>
    import ("../components/order")
const router = new VueRouter({
    routes: [{
            path: "/",
            redirect: "/login"
        },
        {
            path: "/login",
            component: login
        },
        {
            path: "/Home",
            component: Home,
            children: [{
                    path: "/",
                    redirect: "/user"
                },
                {
                    path: "/user",
                    component: user
                },
                {
                    path: "/juese",
                    component: juese
                },
                {
                    path: "/power",
                    component: power
                },
                {
                    path: "/goodHome",
                    component: goodHome,
                },
                {
                    path: "/goodlist",
                    component: goodlist
                },
                {
                    path: "/classify",
                    component: classify
                },
                {
                    path: "/goodclassify",
                    component: goodclassify
                },
                {
                    path: "/order",
                    component: order
                }

            ]

        }
    ],
})

export default router